﻿using System.Collections.Generic;
using System.Threading.Tasks;
using YNTK.System.Entitys.Permission;

namespace YNTK.System.Interfaces.Permission
{
    /// <summary>
    /// 机构服务
    /// 版 本：V1.0.0.0.0
    /// 版 权：云南通科科技有限公司（https://www.yntkkj.com）
    /// 作 者：李仕鹏
    /// 日 期：2022.10.07 
    /// </summary>
    public interface IMechanismService
    {
        /// <summary>
        /// 根据机构id获取机构信息
        /// </summary>
        /// <param name="id">机构id</param>
        /// <returns></returns>
        Task<MechanismEntity> GetMechanismInfoAsync(string id);

        /// <summary>
        /// 获取机构数据
        /// </summary>
        /// <param name="organizeId">组织id</param>
        /// <param name="ids">机构id集合</param>
        /// <returns></returns>
        Task<List<MechanismEntity>> GetMechanismListAsync(string organizeId, List<string> ids);

        /// <summary>
        /// 处理机构id拼接上所有父级id
        /// </summary>
        /// <param name="id">机构id</param>
        /// <param name="organizeId">组织id</param>
        /// <returns></returns>
        Task<string> GetIdAsync(string id, string organizeId);

        /// <summary>
        /// 处理机构id拼接上所有父级id
        /// </summary>
        /// <param name="ids">id集合(最后一级的id)</param>
        /// <param name="organizeId">组织id</param>
        /// <returns>key.id  value.(Item1.拼接上所有父级的id,Item2.最后一级的机构名称)</returns>
        Task<Dictionary<string, (string, string)>> GetIdsAsync(List<string> ids, string organizeId);
    }
}
